package com.xzh.springCloud.service;

import com.xzh.springCloud.entity.Result;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.stereotype.Component;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;

/**
 * @Author: zhiHong
 * @CreateTime: 2023-08-27 10:41
 * @Description: 请求服务
 */
@Component
@FeignClient("MEMBER-SERVICE-PROVIDER")
public interface MemberFeignService {

    /**
     * 1. 远程调用的方式是 GET
     * 2. 远程调用的 url: http://MEMBER-SERVICE-PROVIDER/member/consumer/get/{id}
     * 3. MEMBER-SERVICE-PROVIDER 就是在 eureka 注册的服务
     * 4. openfeign 会根据负载均衡来决定调用的是哪个服务
     */
    @GetMapping("/member/get/{id}")
    public Result getMemberById(@PathVariable("id") Long id);
}
